//ObjectAdapter.java
package adapter.objectadapter;

/**
 *@author:youtubezou
 *@version:2012-7-16
 */
public class ObjectAdapter implements Product {
	private String name;
	private double price = -1;
	private double weight = -1;
	private String str;
	
	public ObjectAdapter(Apple apple){
		name = apple.getName();
		weight = apple.getWeight();
		str = apple.toString();
	}
	
	public ObjectAdapter(Book book){
		name = book.getName();
		price = book.getPrice();
		str = book.toString();
	}
	
	public String getName() {
		return name;
	}

	
	public double getPrice() {
		return price;
	}
	
	public double getWeight(){
		return weight;
	}
	
	public String toString(){
		return str;
	}

}
